import "package:ct_pa_majordomo/utils/request.dart";
import "package:dio/dio.dart";

class CommonApi {
  /// 上传文件
  Future<Map> upload(FormData data) async {
    Response response = await request.post(
      "file/upload",
      data: data,
    );
    return response.data ?? {};
  }
  /// 获取地区列表
  Future<Map> getRegionLazyTree(String parentCode) async {
    Response response = await request.get(
      "system/region/lazy-tree",
      queryParameters: {
        "parentCode": parentCode,
      },
    );
    return response.data ?? {};
  }
}

CommonApi commonApi = CommonApi();